package cn.com.service.impl;

import cn.com.beans.PRole;
import cn.com.mapper.RoleMapper;
import cn.com.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

  

    @Resource
    private RoleMapper roleMapper;



    @Override
    public boolean deleteByIds(Integer... ids) {
        return roleMapper.deleteByIds(ids)>0;
    }

    @Override
    public boolean insert(PRole role) {
        return roleMapper.insert(role)>0;
    }

    @Override
    public List<PRole> findAll(PRole role) {
        return roleMapper.findAll(role);
    }

    @Override
    public List<PRole> findByAccountId(Integer accountId) {
        return roleMapper.findByAccountId(accountId);
    }

    @Override
    public PRole findByid(Integer id) {
        return roleMapper.findByid(id);
    }


    @Override
    public boolean update(PRole role) {
        return roleMapper.update(role)>0;
    }
}
